import React, { Component } from 'react'
import Swiper from 'swiper'
import 'swiper/css/swiper.min.css'
export default class swipers extends Component {
    state={
        pic:['swiper/01.jpeg','swiper/02.jpeg']
    }
    render() {
        const {pic} = this.state
        return (
            <div className="swipers">
                <div className="swiper-container">
                    <div className="swiper-wrapper">
                        {
                            pic.map((item,key)=>{
                                return <div key={key} className="swiper-slide">
                                    <img src={require('../../static/'+item)}/>
                                </div>
                            })
                        }
                        
                    </div>
                </div>
            </div>
        )
    }
    componentDidMount(){
        new Swiper('.swiper-container', {
            autoplay: true
        })
    }
}
